package gui;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.LayoutManager;
import javax.swing.ImageIcon;
import javax.swing.JPanel;

public class ImagePanel extends JPanel {
	/* the default image to use */
	Image image = null;

	public ImagePanel(String image) {
		super();
		this.image = new ImageIcon(image).getImage();
	}

	public ImagePanel(LayoutManager layout) {
		super(layout);
	}

	public void paintComponent(Graphics g) {
		
		super.paintComponent(g);

		if (image != null)
			g.drawImage(image, 0, 0, getWidth(), getHeight(), this);
	}
}
